package com.coffee.core.enums;

public enum OrderTypeEnum {
    SKU("sku", "普通商品订单"),
    ENJOY("enjoy", "先享后付订单"),
    PART("part", "拼团订单"),
    INTEGRAL("integral", "积分订单"),
    CAR("car", "购物车订单"),
    SAMPLE("sample", "样品订单"),
    INQUIRE("inquire", "期货订单"),
    LOGISTICS("logistics", "物流订单"),
    TESTING("testing", "检测订单"),
    PERIODIZATION("periodization", "分期购"),
    BALANCE("balance", "余额充值"),
    INQUIRELOGISTICS("inquireLogistics", "期货物流订单");

    private String code;
    private String name;

    private OrderTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static OrderTypeEnum getByCode(String code) {
        for (OrderTypeEnum item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
